package com.gdkj.enums;

/**
 * @Author zhangp
 * @Description // 钻石记录类型枚举
 * @Date 2022/10/31
 **/
public enum DiggingEnergyRecordTypeEnums {
    FIRST_GIFY (1, "首次赠送"),
    GOLD_BEAN_EXCHANGE(2, "金豆兑换"),
    AD_EXCHANGE(3, "广告兑换"),
    DIG(4, "挖掘"),
    TASK(5, "任务奖励"),
    UP_LEVEL(6, "通关奖励"),
    SHARE(7, "分享奖励"),
    SOIL_EXCHANGE(8, "土壤道具转化"),
   SHIELD_EXCHANGE(9, "护盾道具转化"),
    BLACK_ROOM_EXCHANGE(10, "小黑屋道具转化"),
    KEY_EXCHANGE(11, "钥匙道具转化"),
    AUTO_UPDATE(12, "自动恢复"),
    SIGN_AWARD(13, "签到奖励"),
    FILLING_SOIL_SUCCESS_AWARD(14, "去对方星球填土成功获取的奖励"),
    CLOSE_BLACK_HOUSE_SUCCESS_AWARD(15, "关小黑屋成功获取的奖励"),
    LUCK_DRAW(16, "抽奖"),
    SEND_FREE_ENERGY(17,"免费补充钻石"),
    OTHER_DIG(18, "他人挖掘"),
    ANY_DOOR_EXCHANGE(19, "任意门道具转化");

    private Integer value;

    private String name;

    DiggingEnergyRecordTypeEnums(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据value获取name值
     * @author chenyanqian
     * @date 2022/11/2
     * @param value : code
     * @return : java.lang.String
     */
    public static String getNameByValue(Integer value){
        DiggingEnergyRecordTypeEnums[] enums = DiggingEnergyRecordTypeEnums.values();
        for (DiggingEnergyRecordTypeEnums typeEnums : enums){
            if(typeEnums.value.equals(value)){
                return typeEnums.name;
            }
        }
        return null;
    }

    /**
     * 根据value获取类型值
     * @return : DiggingEnergyRecordTypeEnums
     */
    public static DiggingEnergyRecordTypeEnums getValueByType(Integer value) {
        DiggingEnergyRecordTypeEnums[] enums = DiggingEnergyRecordTypeEnums.values();
        for (DiggingEnergyRecordTypeEnums typeEnums : enums){
            if(typeEnums.value.equals(value)){
                return typeEnums;
            }
        }
        return null;
    }

}
